import turtle

def draw_stick_figure():
    # 设置画布和画笔
    screen = turtle.Screen()
    screen.title("火柴人")
    pen = turtle.Turtle()
    pen.speed(3)  
    
    # 绘制头部（圆形）
    pen.penup()
    pen.goto(0, 100)
    pen.pendown()
    pen.circle(50) 
    
    # 绘制身体（直线）
    pen.penup()
    pen.goto(0, 50)  
    pen.pendown()
    pen.goto(0, -50)  
    
    # 绘制左手
    pen.penup()
    pen.goto(0, 0)  
    pen.pendown()
    pen.goto(-50, 30)  
    
    # 绘制右手
    pen.penup()
    pen.goto(0, 0)  
    pen.pendown()
    pen.goto(50, 30)  
    
    # 绘制左腿
    pen.penup()
    pen.goto(0, -50)  
    pen.pendown()
    pen.goto(-40, -120)  
    
    # 绘制右腿
    pen.penup()
    pen.goto(0, -50)  
    pen.pendown()
    pen.goto(40, -120)  
    
    # 隐藏画笔
    pen.hideturtle()
    
    # 点击关闭窗口
    screen.exitonclick()

if __name__ == "__main__":
    draw_stick_figure()
    